class MyClass:
    big_val = "类变量,可通过类访问"
    def __init__(self, name,age):
        self.name = name
        self.age = age

    def modifyName(self, new_name):
        self.name = new_name
        print("修改后的名字为:", self.name)

if __name__ == '__main__':
    my_obj = MyClass("小明", 18)
    print(MyClass.big_val)
    print(my_obj.big_val)
    print(my_obj.name)
    print(my_obj.age)
    my_obj.modifyName("小红")